<template>
	<view class="">
		<view class="padding bg-white radius">
			<view class="flex justify-between">
				<view>
					<view>
						<text
							class="text-black text-size-38 text-bold">{{ props.userinfo.name?props.userinfo.name:'获取失败' }}</text>
							<text class="cu-tag bg-menu round margin-left-sm">{{ props.userinfo.shopTypeName?props.userinfo.shopTypeName:'获取失败' }}</text>
					</view>
					<view class="text-size-14">
						{{ props.userinfo.communityName?props.userinfo.communityName:'暂无社区' }}
					</view>
					<view class="text-size-14">
						{{ props.userinfo.address?props.userinfo.address:'暂无地址' }}
					</view>
				</view>
				<view @click="handleUserInfo" class="text-center">
					<image v-if="props.userinfo.thumbnail" class="image_107 round" :src="userinfo.thumbnail">
					</image>
					<view v-else class="cu-avatar round">
						<text class="cuIcon-people size-32"></text>
					</view>
					<!-- 		<view class="cu-tag sm bg-orange radius">{{props.userinfo.postName}}
					</view> -->
				</view>
			</view>
			<view class="flex justify-between margin-top">
				<view class="text-size-14">
					<text class="cuIcon-phone text-olive margin-right-sm"></text>
					<text v-if="props.userinfo.phone">{{ props.userinfo.phone }}</text>
					<text v-else>获取失败</text>
				</view>
				<view>
					<button open-type="share" class="cuIcon-share size-20 round"></button>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script setup lang="ts">
	import {
		useSettingStore
	} from '@/stores/index';
	const setting = useSettingStore();
	const emit = defineEmits(['action']);
	const props = defineProps({
		title: {
			type: String,
			default: '标题'
		},
		userinfo: {
			default: () => {
				return {
					"id": "17379006305000199",
					"communityId": "18853483084000176",
					"housingEstateIds": [],
					"housingEstateNames": [],
					"communityName": "清源社区",
					"shopTypeId": "19032413391000189",
					"shopTypeName": "保洁",
					"thumbnail": "https://www.shuimuqingyuan.cn/img/2023-11-09/ccf1cdc744504d589c6bce34db76a081.jpeg",
					"name": "清源食堂",
					"address": "四川省成都市锦江区橡树林西路77号1层",
					"region": "四川省成都市成华区",
					"lon": "104.07984",
					"lat": "30.657457",
					"description": "清源食堂清源食堂清源食堂清源食堂清源食堂清源食堂清源食堂清源食堂",
					"businessLicense": "https://www.shuimuqingyuan.cn/img/2023-11-09/3e8028aa8c3f417b91a48fcad94be99e.jpg",
					"liaison": "成都橡树林餐饮有限公司",
					"phone": "18716643045",
					"corporationName": "孙秋龙",
					"idCardFront": "https://www.shuimuqingyuan.cn/img/2023-11-09/5a5f5739a5fc4e7085186e074d8940f1.jpg",
					"idCardBack": "https://www.shuimuqingyuan.cn/img/2023-11-09/c259b24fe2344fb39ac14b142c811fca.jpg",
					"foodBusinessLicense": "https://www.shuimuqingyuan.cn/img/2023-11-09/658b5aeb92a64ccfb596a663cb3e5673.jpg",
					"businessState": 1,
					"startTime": null,
					"endTime": null,
					"state": 0,
					"opinion": null,
					"createTime": "2023-10-20 16:31:06"
				}
			}
		}
	})
	const handleUserInfo = (e) => {
		emit('action', props.userinfo)
	}
</script>

<style scoped>
	.cu-bar {
		min-height: 30px;
	}
</style>